package com.mode.composite.pattern;

/**
 * 客户端
 */
public class Test {

    public static void main(String[] args) {
        ConcreteCompany concreteCompany = new ConcreteCompany("北京朝阳公司");
        concreteCompany.add(new HRDepartment("北京朝阳公司人力资源部"));

        ConcreteCompany concreteCompany1 = new ConcreteCompany("上海虹桥公司");
        concreteCompany1.add(new HRDepartment("上海虹桥人力资源部"));
        concreteCompany.add(concreteCompany1);

        ConcreteCompany concreteCompany2 = new ConcreteCompany("深圳南山公司");
        concreteCompany2.add(new HRDepartment("深圳南山人力资源部"));
        concreteCompany1.add(concreteCompany2);

        concreteCompany.display(1);
        concreteCompany.LineOfDuty();
    }
}
